package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpShopSubjectDao;
import com.financing.platform.dto.FpShopSubjectDTO;
import com.financing.platform.service.IFpShopSubjectService;
/**
 * fp_shop_subject  
 * 店铺题目表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopSubjectService")
public class FpShopSubjectServiceImpl implements IFpShopSubjectService{

	@Autowired
	private IFpShopSubjectDao fpShopSubjectDao;

	@Override
	public int insert(FpShopSubjectDTO fpShopSubject) throws SQLException {
//		DTOdateSetUtil.setCreateInfo(fpShopSubject);
//		DTOdateSetUtil.setUpdateInfo(fpShopSubject);
//		fpShopSubject.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		return fpShopSubjectDao.insert(fpShopSubject);
	}

	@Override
	public void update(FpShopSubjectDTO fpShopSubject) throws SQLException {
		fpShopSubjectDao.update(fpShopSubject);
	}

	@Override
	public void updateForce(FpShopSubjectDTO fpShopSubject) throws SQLException {
		fpShopSubjectDao.updateForce(fpShopSubject);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpShopSubjectDao.delete(id);
	}
	
	@Override
	public List<FpShopSubjectDTO> queryList(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return fpShopSubjectDao.queryList(fpShopSubject);
	}

	@Override
	public int queryListCount(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return fpShopSubjectDao.queryListCount(fpShopSubject);
	}

	@Override
	public FpShopSubjectDTO loadById(Integer id) throws SQLException {
		return fpShopSubjectDao.loadById(id);
	}
 	@Override
	public FpShopSubjectDTO queryListGetFirst(FpShopSubjectDTO fpShopSubject)
			throws SQLException {
		 List<FpShopSubjectDTO> queryList = queryList(fpShopSubject);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopSubjectDTO();
		 }
		 return queryList.get(0);
	}
}
